#!/bin/bash

day=7
while getopts ":d:" opt;
do
    case $opt in
        d)
            day=$OPTARG
            ;;
        *)
            echo "How to use: $0 [-d DAY]"
            exit 1
            ;;
        ?)
            echo "Option -$OPTARG requires an argument."
            exit 1
            ;;
    esac
done

echo $day
